package com.core.image.tcp;

import com.core.image.core.box.StringRecevicePacket;
import com.core.image.handler.ConnectorStringPacketChain;

/**
 * describe:
 *
 * @author 库琦
 * @date 2020/02/05/23:44
 */
public class ServerStatistics {
    long receiveSize;
    long sendSize;
    ConnectorStringPacketChain stringPacketChain(){
        return new StatisticsConnectorStringPacketChain();
    }
    class StatisticsConnectorStringPacketChain extends ConnectorStringPacketChain{
        @Override
        public boolean consume(ConnectorHandler clientHandler, StringRecevicePacket packet) {
            // 接收数据量自增
            receiveSize++;
            return false;
        }
    }
}
